package com.demo2do.sms.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.sms.dao.SmsDao;
import com.demo2do.sms.entity.sms.SmsCompany;
import com.demo2do.sms.entity.sms.SmsRecord;
import com.demo2do.sms.service.SmsService;

/**
 * 
 * @author mohanlan
 *
 */
@Service("smsService")
public class SmsServiceImpl implements SmsService {
    
    @Dao
    private SmsDao smsDao;
    
    /*
     * (non-Javadoc)
     * @see com.demo2do.sms.service.SmsService#load(java.lang.String)
     */
    public SmsCompany loadCompany(String client) {
        return smsDao.loadCompany(client);
    }
    
    /*
     * (non-Javadoc)
     * @see com.demo2do.sms.service.SmsService#loadSms(java.lang.Long)
     */
    public SmsRecord loadSms(Long id) {
        return smsDao.loadRecord(id);
    }
    
    /*
     * (non-Javadoc)
     * @see com.demo2do.sms.service.SmsService#listSms(java.util.List)
     */
    public List<SmsRecord> listSms(List<Long> ids) {
        return smsDao.list(ids);
    }
    
    /*
     * (non-Javadoc)
     * @see com.demo2do.sms.service.SmsService#create(com.demo2do.sms.entity.sms.SmsRecord)
     */
    public void create(SmsRecord smsRecord) {
        smsDao.save(smsRecord);
    }
    
    /*
     * (non-Javadoc)
     * @see com.demo2do.sms.service.SmsService#create(java.util.List)
     */
    public void create(List<SmsRecord> smsRecords) {
        
        for(SmsRecord smsRecord : smsRecords) {
            smsDao.save(smsRecord);
            
        }
    }
}
